home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 1995 May / PC Answers CD-ROM 7 (Future Publishing) (May 1995).iso / vbits / code / cert / trk3_eg / random / frmrand.frm (.txt) next >
Encoding:
Visual Basic Form  |  1994-11-29  |  2.6 KB  |  103 lines

  1. VERSION 2.00
  2. Begin Form frmRand 
  3.    Caption         =   "Football Pool"
  4.    ClientHeight    =   5430
  5.    ClientLeft      =   1080
  6.    ClientTop       =   1230
  7.    ClientWidth     =   7380
  8.    Height          =   5835
  9.    Left            =   1020
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   5430
  12.    ScaleWidth      =   7380
  13.    Top             =   885
  14.    Width           =   7500
  15.    Begin CommandButton Command1 
  16.       Caption         =   "Insert Numbers"
  17.       Height          =   495
  18.       Left            =   5760
  19.       TabIndex        =   3
  20.       Top             =   4440
  21.       Width           =   1455
  22.    End
  23.    Begin TextBox Text1 
  24.       BorderStyle     =   0  'None
  25.       FontBold        =   -1  'True
  26.       FontItalic      =   0   'False
  27.       FontName        =   "MS Sans Serif"
  28.       FontSize        =   18
  29.       FontStrikethru  =   0   'False
  30.       FontUnderline   =   0   'False
  31.       Height          =   1335
  32.       Left            =   6000
  33.       MultiLine       =   -1  'True
  34.       TabIndex        =   2
  35.       Text            =   "AFC"
  36.       Top             =   1800
  37.       Width           =   375
  38.    End
  39.    Begin Grid Grid1 
  40.       Cols            =   14
  41.       FixedCols       =   0
  42.       FixedRows       =   0
  43.       Height          =   5000
  44.       Left            =   240
  45.       Rows            =   14
  46.       TabIndex        =   0
  47.       Top             =   480
  48.       Width           =   5000
  49.    End
  50.    Begin Label Label1 
  51.       AutoSize        =   -1  'True
  52.       Caption         =   "NFC"
  53.       FontBold        =   -1  'True
  54.       FontItalic      =   0   'False
  55.       FontName        =   "MS Sans Serif"
  56.       FontSize        =   18
  57.       FontStrikethru  =   0   'False
  58.       FontUnderline   =   0   'False
  59.       Height          =   435
  60.       Left            =   2280
  61.       TabIndex        =   1
  62.       Top             =   0
  63.       Width           =   975
  64.    End
  65. Option Explicit
  66. Sub Command1_Click ()
  67. Dim cnt As Integer
  68. Dim cnt2 As Integer
  69. Dim cnt3 As Long
  70. Dim num As Integer
  71. For cnt = 0 To 3
  72. Grid1.Row = cnt
  73. ReDim CntArray(9) As Integer
  74. For cnt2 = 0 To 9
  75. Grid1.Col = cnt2
  76. cnt3 = cnt3 + 1
  77. num = Int(Rnd * 10)
  78. Loop While CntArray(num) = True
  79. CntArray(num) = True
  80. Grid1.Text = num
  81. Next cnt2
  82. Next cnt
  83. For cnt = 10 To 13
  84. Grid1.Col = cnt
  85. ReDim CntArray(9) As Integer
  86. For cnt2 = 4 To 13
  87. Grid1.Row = cnt2
  88. cnt3 = cnt3 + 1
  89. num = Int(Rnd * 10)
  90. Loop While CntArray(num) = True
  91. CntArray(num) = True
  92. Grid1.Text = num
  93. Next cnt2
  94. Next cnt
  95. End Sub
  96. Sub Form_Load ()
  97. Dim cnt As Integer
  98. For cnt = 0 To 13
  99.     Grid1.ColWidth(cnt) = 330
  100.     Grid1.RowHeight(cnt) = 330
  101. Next cnt
  102. End Sub
  103.